<template>
  <div class="dashboard-container">
    <div class="app-container">
      <div v-if="user">
        <el-row :gutter="20">
          <el-col :span="6" :xs="24">
            <user-card :user="user" />
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import adminDashboard from "./admin";
import editorDashboard from "./editor";

import UserCard from '@/views/profile/components/UserCard'

export default {
  name: "Dashboard",
  components: { UserCard, adminDashboard, editorDashboard },
  data() {
    return {
      currentRole: "adminDashboard",
    };
  },
  computed: {
    ...mapGetters(["name", "avatar", "roles"]),
  },

  created() {
    this.getUser();
    // if (!this.roles.includes('admin')) {
    //   this.currentRole = 'editorDashboard'
    // }
  },
  methods: {
    getUser() {
      this.user = {
        name: this.name,
        role: this.roles.join(" | "),
        email: "admin@test.com",
        avatar: this.avatar,
      };
    },
  },
};
</script>
